import {
    knowledge_page_views
} from "~/api";

export const useContent = () => {
    const videoPreviewRef = ref(null);

    const onPreview = async (item) => {
        await knowledge_page_views({ id: item.id });
        item.views = item.views + 1;
        videoPreviewRef.value.show(item.video_file);
    }

    return {
        videoPreviewRef,
        onPreview,
    }
}